#ifndef CCGprsEngine_H_
#define CCGprsEngine_H_

#include <es_sock.h>
#include <CommDbConnPref.h>
#include <commdb.h>
#include <apsettingshandlerui.h>
#include "Common.h"

#ifdef __LOGGER
	#include <flogger.h>
#endif

enum TGprsConnectionProgress 
{
	EGprsIdle,
	EGprsConnected
} ;

class CGprsEngine
{
public:
	
	static CGprsEngine* NewL(TUint& aIAP, RSocketServ& aSocketServ);
	
	CGprsEngine(TUint& aIAP, RSocketServ& aSocketServ);
	virtual ~CGprsEngine();
	
	TInt OpenConnection();
	void CloseConnection();
	
	TBool IsConnected();

	void DataTransferredRequest(TUint& iUploadCounter, TUint& iDownloadCounter);
	void DataTransferredRequest(TDes8& iUploadCounter, TDes8& iDownloadCounter);
	
private:
	void ConstructL();
	

//Private atributtes
private:

	TGprsConnectionProgress iState;
	TCommDbConnPref iPref;
	
	TUint& iGprsIAP;
	RSocketServ& iSocketServ;
	
	RConnection	iConnection;
	
	#ifdef __LOGGER
		RFileLogger iLog;
	#endif

};

#endif /*CCGprsEngine_H_*/
